<template>
  <a-form ref="loginLogFormRef" :model="loginLogModel" :rules="loginLogFormRule" v-bind="layout">
    <a-form-item name="loginUserName" :label="t('org.login-log.loginUserName')">
      <a-input v-model:value="loginLogModel.loginUserName" :placeholder="t('org.login-log.formPlhLoginUserName')" />
    </a-form-item>
    <a-form-item name="loginIp" :label="t('org.login-log.loginIp')">
      <a-input v-model:value="loginLogModel.loginIp" :placeholder="t('org.login-log.formPlhLoginIp')" />
    </a-form-item>
    <a-form-item name="loginArea" :label="t('org.login-log.loginArea')">
      <a-input v-model:value="loginLogModel.loginArea" :placeholder="t('org.login-log.formPlhLoginArea')" />
    </a-form-item>
    <a-form-item name="browser" :label="t('org.login-log.browser')">
      <a-input v-model:value="loginLogModel.browser" :placeholder="t('org.login-log.formPlhBrowser')" />
    </a-form-item>
    <a-form-item name="os" :label="t('org.login-log.os')">
      <a-input v-model:value="loginLogModel.os" :placeholder="t('org.login-log.formPlhOs')" />
    </a-form-item>
    <a-form-item name="createTime" :label="t('org.login-log.createTime')">
      <a-input v-model:value="loginLogModel.createTime" :placeholder="t('org.login-log.formPlhCreateTime')" />
    </a-form-item>
  </a-form>
</template>
<script lang='ts'>
import { defineComponent, ref } from 'vue'
import loginLogApi from '/@/api/org/login-log'
import { loginLogFormRule, loginLogEditUrl } from '../interface'
import { useModelForm } from '/@/kit/model-kit'
import { useI18n } from 'vue-i18n'
export default defineComponent({
  props: {
    loginLogId: String,
  },
  setup(props, { emit }) {
    const { t } = useI18n()
    const loginLogFormRef = ref()
    const loginLogModel = ref({})

    const { save } = useModelForm(loginLogFormRef, loginLogModel, props.loginLogId, loginLogApi)
    //提交方法
    const onSubmit = () => save().then((res) => emit('submitSuccess', res.data.data))
    const layout = {
      labelCol: { span: 7 },
      wrapperCol: { span: 15 },
    }
    return {
      t,
      loginLogFormRef,
      loginLogModel,
      loginLogFormRule,
      layout,
      onSubmit,
    }
  },
})
</script>